<template>
  <div>
    <h1>Movie</h1>
    <p>count模块中的数据:{{count}}</p>
    <button @click="getMovieList">点击获取电影名称</button>
    <ul>
      <li v-for="item in movieList" :key="item.tvId">
        {{item.name}}
      </li>
    </ul>
  </div>
</template>

<script lang="ts">
import {defineComponent} from "vue";
export default defineComponent({
    name:"Movie",
})
</script>

<script lang="ts" setup>
import {storeToRefs} from "pinia";
import {useMovieState} from "../store/movie";
import {useCountState} from "../store/count";
const countState = useCountState()
const {count} = storeToRefs(countState)
const movieState = useMovieState()
const {movieList} = storeToRefs(movieState)
const {getMovieList} = movieState
</script>

<style scoped>
h1{
    background: skyblue;
}
ul{
    padding: 0px;
}
li{
    list-style: none;
    background: yellowgreen;
}
</style>